package com.heima.apis.wemedia;

import com.heima.apis.wemedia.fallback.IWemediaClientFallback;
import com.heima.model.admin.dtos.AuthDto;
import com.heima.model.admin.dtos.ChannelDto;
import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import com.heima.model.wemedia.dtos.WmNewsPageReqDto;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.web.bind.annotation.RequestMapping;
import com.heima.model.user.pojos.ApUser;

@FeignClient(value = "leadnews-wemedia",fallback = IWemediaClientFallback.class)
public interface IWemediaClient {
    /**
     * wm端删除频道远程调用
     * @param id
     * @return
     */
    @GetMapping("/api/v1/channel/del/{id}")
    ResponseResult delChannel(@PathVariable("id") Integer id);


    /**
     * wm端查询频道远程调用
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/channel/list")
    ResponseResult listChannel(@RequestBody ChannelDto dto);


    /**
     * 保存频道信息
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/channel/save")
    ResponseResult saveChannel(@RequestBody WmChannel dto);


    /**
     * 更新频道信息
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/channel/update")
    ResponseResult updateChannel(@RequestBody WmChannel dto);


    /**
     * 删除敏感词
     * @param id
     * @return
     */
    @RequestMapping( "/api/v1/sensitive/del/{id}")
    public ResponseResult delSensitive(@PathVariable("id") Integer id);


    /**
     * 查询敏感词
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/sensitive/list")
    public ResponseResult findList(@RequestBody SensitiveDto dto);

    /**
     * 保存敏感词
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/sensitive/save")
    ResponseResult save(@RequestBody WmSensitive dto);


    @PostMapping("/api/v1/sensitive/update")
    ResponseResult update(@RequestBody WmSensitive dto);

    //查询文章列表
    @PostMapping("/api/v1/news/findList")
    ResponseResult wmNewsList(@RequestBody WmNewsPageReqDto dto);
    //查询文章详情
    @GetMapping("/one_vo/{id}")
    ResponseResult detailsQuery(@PathVariable("id") Integer id);

    @PostMapping("/yesOrNo")
    ResponseResult yesOrNo(@RequestBody NewsAuthDto dto);

    /**
     * 添加新的自媒体用户
     * @param apUser
     * @return
     */
    @PostMapping("/api/v1/wmUser/add")
    ResponseResult addWmUser(ApUser apUser);

}
